<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style type="text/css">
<!--
.style1 {color: #FFFFFF}
-->
</style>
<style> 
.newcolor{background-color:};
.oldcolor{background-color:#FFFFFF};
</style>
<script language="javascript">
function ktemail()
{
var email=document.forms(0).email.value;
e=email.length;
k=e-10; 
	st=email.substr(k,10);
		if (st!="@yahoo.com")
		if(st!="@gmail.com")
			{
				alert( "Sai Email !!!(chỉ cho phép yahoo và Gmail)!!!.ví dụ: abc@yahoo.com , bcd@gmail.com");
				document.forms(0).email.value="";
				document.forms(0).subject.value="";
				return false;
			}
return true;
}
</script>
</head>

<body>
<?php
	if (isset($_REQUEST['email']))
//if "email" is filled out, send email
  {
  //send email
  $email = $_REQUEST['email'] ; 
  $subject = $_REQUEST['subject'] ;
  $message = $_REQUEST['message'] ;
 mail( "nguoidensau0702@yahoo.com", "Subject: $subject","Message: $message", "From: $email" );
	echo "<script>alert('Cảm ơn bạn đã gởi ý kiến. Chúng tôi sẽ trả lời cho bạn trong thời gian ngắn nhất.');location.href='trangchu.php';</script>";
}
?>

<form method='post' action="lienhe.php" name="forms" Onsubmit="return ktemail();">

<table width="602" border="2" cellpadding="0" cellspacing="0" bordercolor="#00CC00">
  <tr>
    <td width="596"><div align="center">
        <table width="596" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
          <tr>
           
            <td width="271" height="28" align="left" valign="middle" background="img/anhnen/Creative_design_Summer_colour.jpg" class="title_sp"><h4 class="style1">Li&ecirc;n h&#7879; v&#7899;i ch&uacute;ng t&ocirc;i</h4></td>
            
          </tr>
          <td width="596" colspan="6"><table width="500" border="0" align="center" cellpadding="0" cellspacing="0">
            <tr align="left">
              <td colspan="2">&nbsp;</td>
            </tr>
            <tr align="left">
              <td colspan="2" ><strong>Bạn có đóng góp ý kiến hay có những thắc mắc về sản phẩm của chúng tôi</strong><br></td>
              </tr>
            <tr align="left">
              <td width="150">Email c&#7911;a b&#7841;n:</td>
              <td><input name='email' type='text' onFocus="this.className='newcolor'" onBlur="this.className='oldcolor'" /></td>
            </tr>
            <tr align="left">
              <td>Ti&ecirc;u &#273;&#7873;:</td>
              <td><input name='subject' type='text' onFocus="this.className='newcolor'" onBlur="this.className='oldcolor'"  onChange="ktemail()" /></td>
            </tr>
            <tr align="left">
              <td valign="top">N&#7897;i dung :</td>
              <td><textarea name='message' rows='15' cols='40' onFocus="this.className='newcolor'" onBlur="this.className='oldcolor'"  onChange="ktemail()" >
              </textarea></td>
            </tr>
            <tr align="left">
              <td>&nbsp;</td>
              <td><input name="submit" class='button2' type='submit' value="Gửi" /></td>
            </tr>
          </table>          <p align="justify">&nbsp;</p>
            </td>
        </table>
    </div></td>
  </tr>
</table>
</form>
<p>&nbsp;</p>

                                                                                      
</body>
</html>
